CC=gcc
CFLAGS=
VERSION=1.0.1
LDFLAGS=-shared -W1,soname,libcalc.so.1
MAIN_LDFLAGS=-L. -lcalc

lib: calc.o
	@$(CC) $(LDFLAGS) -o libcalc.so.$(VERSION) $^
	@ar rcs libcalc.a $^

main: main.o
	@$(CC) -o main $^ $(MAIN_LDFLAGS)

%.o: %.c
	@$(CC) -o $@ -c $< $(CFLAGS)

clean:
	@rm -f main *.so.* *.o *.a
